using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;

using ibba.src.norisk.BusinessLogic;
using ibba.src.global;
using ibba.src.norisk.Contracts;

namespace ibba.src.norisk.ServiceImplementation
{
    [AspNetCompatibilityRequirements(RequirementsMode=System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession,
                     ConcurrencyMode=ConcurrencyMode.Multiple)]
    class Acesso :IAcesso
    {

        private PerfilBL _perfilBL;

        public Acesso(){

            try{
                _perfilBL = new PerfilBL();
            }
            catch (Exception ex)
            {
                global.ErrorHandler.LogAndThrowFaultException(ex);
            }

        }


        public List<string> ObterPerfil(string pUsuario, int pIdSistema)
        {
        
            List<string > retorno  = new List<string>();

            try
            {
                retorno = _perfilBL.ObterPerfil(pUsuario, pIdSistema);
            }
            catch (Exception ex) {
                ErrorHandler.LogAndThrowFaultException(new FaultException(ex.ToString()));
            }

            return( retorno);
        }

        
    }
}

